package com.xiaoshuidi.cloud.module.contract.controller.admin.contract;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.WorkbenchTotalResp;
import com.xiaoshuidi.cloud.module.contract.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.contract.service.contract.WorkbenchTotalService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.xiaoshuidi.cloud.framework.common.pojo.CommonResult.success;

@Slf4j
@Tag(name = "工作台")
@RestController
@RequestMapping(ApiConstants.NAME + "/workbench")
public class WorkbenchTotalController {

    @Resource
    private WorkbenchTotalService workbenchTotalService;


    @PostMapping("/getTotal")
    @Operation(summary = "预收报表分页查询")
    public CommonResult<WorkbenchTotalResp> getTotal(@RequestParam(value = "apartmentId",required = false) Long apartmentId) {
        return success(workbenchTotalService.getTotal(apartmentId));
    }


}
